# Maintainer: David Runge <dvzrv@archlinux.org>

_name=django-environ
pkgname=python-django-environ
pkgver=0.10.0
pkgrel=2
pkgdesc="Utilize 12factor inspired environment variables to configure your Django application"
arch=(any)
url="https://github.com/joke2k/django-environ"
license=(MIT)
depends=(python python-django)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest)
optdepends=('python-simplejson: for an alternative JSON implementation')
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
sha512sums=('6631c959c61754f818a8b2c662e8b265646f29d56d4f4af27dff803445194f7f15cb02e45ced76d508a5fe67773c6e46108791fa3cb3dc6e16c74564c72acefc')
b2sums=('53a39107f47c4d66d2120d5defb3690711b6ce2681f00e00619404f605e3d6b6d61a161020a5eac6b10886a5aef4f7abd2a4b4ad88ee10afaec9c74c23a4eb16')

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-$pkgver
  pytest -vv
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 {AUTHORS,CHANGELOG,README}.rst -t "$pkgdir/usr/share/doc/$pkgname/"
  install -vDm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
}
